home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / CIncludes / ioctl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-05  |  1.9 KB  |  72 lines  |  [TEXT/MPS ]

  1. /*
  2.     IOCtl.h -- Device-handler-specific requests
  3.  
  4.     Warning:  This interface is NOT a part of the ANSI C standard.
  5.              We do NOT claim to be POSIX compliant.
  6.              If you want your code to be portable, don't use this interface.
  7.  
  8.     Copyright, Apple Computer Inc. 1985-1991, 1995
  9.     All rights reserved.
  10. */
  11.  
  12. # ifndef __IOCTL__
  13. # define __IOCTL__
  14.  
  15. /* Conditional Macros:
  16.  *    UsingStaticLibs    - for CFM-68K:  Insures that #pragma import is never used.
  17.  *    <none>            - for CFM-68K:    Insures that all functions and data items are
  18.  *                                    marked as library imports
  19.  */
  20.  
  21.  
  22. /*
  23.  *        ioctl() function prototype
  24.  */
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. #if defined (__CFM68K__) && !defined (UsingStaticLibs)
  31.     #pragma import on
  32. #endif
  33.  
  34. int ioctl(int fildes, unsigned int cmd, long *arg);
  35.  
  36. #if defined (__CFM68K__) && !defined (UsingStaticLibs)
  37.     #pragma import off
  38. #endif
  39.  
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43.  
  44. /*
  45.  *   IO Control commands.
  46.  *
  47.  *   IOCTLs which begin with "FIO" are controls which are general
  48.  *          (device driver) control requests.  They may be executed by 
  49.  *         the top-level ioctl() procedure, or previewed by it before 
  50.  *         passing it on to the driver xxIoctl()s.
  51.  */
  52.  
  53. # define FIOLSEEK         (('f'<<8)|0x00)     /* Apple internal use only */
  54. # define FIODUPFD         (('f'<<8)|0x01)     /* Apple internal use only */
  55.  
  56. # define FIOINTERACTIVE (('f'<<8)|0x02)     /* If device is interactive */
  57. # define FIOBUFSIZE        (('f'<<8)|0x03)     /* Return optimal buffer size */
  58. # define FIOFNAME         (('f'<<8)|0x04)     /* Return filename */
  59. # define FIOREFNUM        (('f'<<8)|0x05)     /* Return fs refnum */
  60. # define FIOSETEOF        (('f'<<8)|0x06)     /* Set file length */
  61.  
  62. /*
  63.  *   IOCTLs which begin with "TIO" are for TTY (i.e., console or 
  64.  *         terminal-related) device control requests.
  65.  */
  66.  
  67. # define TIOFLUSH   (('t'<<8)|0x00)        /* discard unread input.  arg is ignored */
  68. # define TIOSPORT   (('t'<<8)|0x01)        /* Obsolete -- do not use */
  69. # define TIOGPORT   (('t'<<8)|0x02)        /* Obsolete -- do not use */
  70.  
  71. # endif /*__IOCTL__*/
  72.